import time
import functools


def timer(func):
    @functools.wraps(func)
    def wrapper(*args, **kwargs):
        start = time.time()
        result = func(*args, **kwargs)
        end = time.time()
        print(f"函数 {func.__name__} 运行时间为 {end - start} 秒")
        return result

    return wrapper


@timer
def c():
    count = 0
    for i in range(10000000):
        count += 1
    print(count)

if __name__ == '__main__':
    c()
